package com.example.service;

import com.example.base.BaseCrudDao;
import com.example.base.BaseCrudService;
import com.example.dao.UserDao;
import com.example.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service("UserService")
public class UserService extends BaseCrudService<BaseCrudDao<User>, User> {

    @Autowired
    UserDao userDao;

    /**
     * 根据账号和密码登录查询（完全匹配）
     */
    public User selectByNumberAndPassword(String userNumber, String userPassword, String userType){
        return userDao.selectByNumberAndPassword(userNumber, userPassword, userType);
    }

    /**
     * 根据账号查询（完全匹配）
     */
    public User selectByNumber(String userNumber, Integer userType){
        return userDao.selectByNumber(userNumber,userType);
    }

    /**
     * 根据身份获取数量
     */
    public Integer selectCountByType(Integer userType){
        return userDao.selectCountByType(userType);
    }

}
